* nsselect.m (Fx_selection_exists_p): Just return Qnil if window system
authorJan Djärv <jan.h.d@swipnet.se>
Mon, 5 May 2014 17:37:43 +0000 (19:37 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Mon, 5 May 2014 17:37:43 +0000 (19:37 +0200)
not initialized.

Fixes: debbugs:17398
src/ChangeLog
src/nsselect.m

index 0f6aaf93598150d5bad6ba1bb0c1b2bb87b4f792..9839b6a214676587caf3e9ab3f74a8a8f4077888 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-05  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsselect.m (Fx_selection_exists_p): Just return Qnil if window system
+       not initialized (Bug#17398).
+
 2014-05-04  Paul Eggert  <eggert@cs.ucla.edu>
 
        Revert recent libpng changes (Bug#17339).
index f4713cb5e10c3e053740688af76e860d09f7856e..038849c0aed7ef2413c6766c0f65eab307a56ed6 100644 (file)
@@ -429,7 +429,9 @@ On Nextstep, TERMINAL is unused.  */)
   id pb;
   NSArray *types;
 
-  check_window_system (NULL);
+  if (!window_system_available (NULL))
+    return Qnil;
+
   CHECK_SYMBOL (selection);
   if (EQ (selection, Qnil)) selection = QPRIMARY;
   if (EQ (selection, Qt)) selection = QSECONDARY;